/**
 * 
 */
var eventInfo;
$(function(){
	$('#audio').hide();
	$.ajax({
		url:'Event_eventId.action',
		type:'get',
		dataType:'json',
		success:function(data){
			eventInfo=data[0];
			$('#reporterName').val(eventInfo.REPORTERNAME);
			$('#reporterId').val(eventInfo.REPORTERID);
			$('#reporterPhoneNum').val(eventInfo.REPORTERPHONENUM);
			$('#eventId10').html(eventInfo.EVENTID);
			$('#EventStatus10').html(eventInfo.EVENTSTATUS);
			$('#reporterMail').val(eventInfo.REPORTERMAIL);
			$('#classRoom').val(eventInfo.CLASSNAME);
			$('#Monitor').val(eventInfo.REPORTERMONITORNAME);
			$('#Director').val(eventInfo.REPORTERDIRECTORNAME);
			$('#eventDate').val(eventInfo.EVENTDATE);
			$('#eventType').val(eventInfo.EVENTTYPE);
			$('#department').val(eventInfo.DEPARTMENTNAME);
			$('#username').val(eventInfo.USERNAME);
			$('#phone').val(eventInfo.PHONE);
			$('#eventContent').val(eventInfo.EVENTCONTENT);
			if(checkPlayer()){
				//html5播放器
				$('#audioSpan').html("<audio src=\"Audio_get?eventId="+eventInfo.EVENTID+"\" controls=\"controls\"></audio><iframe id=\"tmp_downloadhelper_iframe\" style=\"display: none;\"></iframe>");
			}else{
				//微软播放器
				$('#audioSpan').html("<embed src=\"Audio_get?eventId="+eventInfo.EVENTID+"\" height=\"50px\" width=\"300px\"pluginspage=\"http://www.microsoft.com/isapi/redir.dll?prd=windows&sbp=mediaplayer&ar=media&sba=plugin&\" type=\"application/x-mplayer2\" border=\"0\" width=\"100%\" height=\"40\" showcontrols=\"1\" showaudiocontrols=\"1\" showstatusbar=\"1\" autostart=\"0\" loop=\"0\" enablecontextmenu=\"1\"></embed>");
			}
			var data='eventId='+eventInfo.EVENTID;
			$.ajax({
				url:'Audio_exist',
				data:data,
				dataType:'json',
				success:function(data){
					if(data.RESULT)
						$('#audio').show();
				}
			});
		}
	})
})

//根据是否支持浏览器 显示不同的播放器
function checkPlayer(){
		 if (window.applicationCache) {
	         return true;
	     } else {
	         return false;
	     }
}